<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title></title>
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
    <link rel="stylesheet" type="text/css" href="/zhenze/Public/home/css/reset.css"/>
    <link rel="stylesheet" href="/zhenze/Public/home/css/huodongxiangqing.css"/>
    <link rel="stylesheet" href="/zhenze/Public/home/css/font-awesome.min.css"/>
</head>
<body>
<div class="top">
    <a href=""><i class="fa fa-angle-left"></i>
        <p>活动详情</p></a>
</div>
<div class="cont">
    <ul id="gudong">
        <li style="font-size: 0.75rem;">参与人员</li>
        <?php if(is_array($EventUser)): foreach($EventUser as $k=>$v): ?><li><p><?php echo (date('Y-m-d H:m:s',$v["addtime"])); ?></p>
                <p><?php echo ($v["nickname"]); ?></p>
                <p><?php echo ($v["mobile"]); ?></p></li><?php endforeach; endif; ?>
    </ul>
    <input type="hidden" id="id" value="<?php echo ($id); ?>">
    <input type="hidden" id="page" value="1">
    <input type="hidden" id="count" value="<?php echo ($totpage); ?>">
    <ul id="loading">
        <li id="page_Event_user" style="text-align:center;font-weight:bold; font-size:30px;">加载更多>>>></li>
    </ul>
</div>
<script type="text/javascript" src="/zhenze/Public/home/js/jquery-3.1.1.min.js" ></script>
<script src="/zhenze/Public/home/js/screenSize.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
    $("#page_Event_user").click(function () {
        var id = $('#id').val();
        var nowpage = parseInt($('#page').val()) + 1;//解析字符串转换为整数+1；得2；
        var count = $('#count').val();   //总页数
        if (count > nowpage) {   // 当设置请求的当前页面，小于总页数执行ajax翻页；
            $.getJSON(
                    "<?php echo U('seller/detailsSeller');?>&p="+nowpage+"&id="+id,
                    function(result){
                        $('#page').val(nowpage);//重置当前页数
                        var data= result.EventUser;
                        console.log(data);
                        if(data.length>0){
                            var html="";
                            for(var i=0;i<data.length;i++){
                                html += '<li><p>'+data[i].addtime+'</p>';
                                html += '<p>'+data[i].nickname+'</p>'
                                html += '<p>'+data[i].mobile+'</p></li>';
                            }
                            $("#gudong").append(html);
                        }else{
                            $("#page_Event_user").html('亲，没有数据了！');
                        }
                    })
        } else {
            $("#page_Event_user").html('加载完毕！')
        }
    })
</script>
</body>
</html>